cd "C:\Users\49669\Desktop\小论文\计量数据\数据"
use have,clear
gen case2=1
replace case2=2 if case>5&case<11   
replace case2=3 if case>10&case<21 
replace case2=4 if case>20
describe
gen lprice=ln(price)
gen lhousehold=ln(household)
gen	lhospital=ln(hospital)
gen	lsubway=ln(subway)
gen	lshopping=ln(shopping)

ologit case2 landlord lprice age plot lhousehold elevator floor 品牌 lhospital lsubway lshopping, robust
margins, dydx(*) post
outreg2 using 3.doc,replace ctitle(mlogit)

qui ologit case2 landlord lprice age plot lhousehold elevator floor  lhospital lsubway lshopping, robust
margins, at(landlord = (0.3(0.972) 5.16)) predict(outcome(1)) vsquish //不同取值时的平均预测概率
margins, at(landlord = (0.3(0.972) 5.16)) predict(outcome(2)) vsquish
margins, at(landlord = (0.3(0.972) 5.16)) predict(outcome(3)) vsquish
margins, at(landlord = (0.3(0.972) 5.16)) predict(outcome(4)) vsquish

poisson case landlord lprice age plot lhousehold elevator floor 品牌 lhospital lsubway lshopping,robust
outreg2 using i.doc,replace ctitle(poisson2)

heckman case landlord lprice age plot lhousehold floor lhospital lsubway lshopping,select(case2=landlord lprice age plot lhousehold floor market lhospital lsubway lshopping)twostep
